package public

import (
	"gorm.io/datatypes"
	"time"
)

type OnlineServiceQuestion struct {
	ID       uint           `json:"q_id" form:"q_id" gorm:"primarykey;column:q_id;"` // 主键ID
	Pid      uint           `json:"pid" form:"pid" gorm:"column:pid;"`               // 父级ID
	Question string         `json:"question" form:"question" gorm:"question;"`       // 问题
	Types    uint           `json:"type" form:"type" gorm:"types;"`                  // 答案类型 1选项 2文本
	Info     datatypes.JSON `json:"info" form:"info" gorm:"info;"`                   // 信息值 1有/去过/满意/ 2没有/没去过/不满意 3文本信息
	Tag      uint           `json:"tag" form:"tag" gorm:"tag;"`                      // 标签 1是 2不是
}

type OnlineServiceAnswer struct {
	ID         uint           `json:"a_id" form:"a_id" gorm:"primarykey;column:a_id;"`    // 回答ID
	Uid        uint           `json:"u_id" form:"u_id" gorm:"column:u_id;"`               // 用户ID
	Answer     datatypes.JSON `json:"answer" form:"answer" gorm:"answer;"`                // 问卷答案结果集
	CreatedAt  time.Time      `json:"create_time" form:"create_time" gorm:"create_time;"` // 创建时间
	ReadStatus uint           `json:"info" form:"info" gorm:"info;"`                      // 客服读取状态 1已读 2未读
}

// TableName 在线客服问题表 fd_online_service_question
func (OnlineServiceQuestion) TableName() string {
	return "fd_online_service_question"
}

// TableName 在线客服用户回答表 fd_online_service_answer
func (OnlineServiceAnswer) TableName() string {
	return "fd_online_service_answer"
}
